home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / pc_board / rnet108u.zip / PCBLOGIN.SLT < prev    next >
Text File  |  1992-07-27  |  9KB  |  250 lines

  1. // ------------------------------------------------------------------------- //
  2. //
  3. //   PCBoard Login Script -- Handles Lang, Graphics, login name, password.
  4. //     Processes until main board command.  Will "register" if not current.
  5. //     Automatically goes into a specified door from PCBoard/ProLogon.
  6. //
  7. //     Modification of track values may be needed to properly handle
  8. //     modified prompts if the host sysop has used that option.
  9. //
  10. //     Compile with   CS PCBLOGIN   which will produce PCBLOGIN.SLC.
  11. //     Add PCBLOGIN for autoscript entry in your telix dialing directory.
  12. //
  13. //     10-31-1988  Added newuser processing
  14. //     07-16-1989  Added ProLogin support and ProLogon quick logon
  15. //     01-17-1990  Added pop-up windows
  16. //
  17. //     Note: Does not handle "Is this really you" prompt from PCBoard 14.5a
  18. //
  19. //     Robert Vostreys, FTL Sysop, 404-292-8761, 404-299-3930 HST
  20. //
  21. // ------------------------------------------------------------------------- //
  22. //
  23. //  Edit the string entries below to reflect the login needed for echomail.
  24. //
  25. //  Set the pro_door[] and first_cmd[] strings to point to the mail door.
  26. //
  27. //  Compile (CS PCBLOGIN) and place this as the autoscript in your Telix
  28. //  dialing directory entries used for netmail.  If you use a different login
  29. //  for yourself vs echomail (suggested), you may want to rename this script
  30. //  to something else so you use PCBLOGIN for your own login and perhaps
  31. //  NETLOGIN for echomail login since the username is different.
  32. //
  33. //  I recommend using different dialing directory entries for personal and
  34. //  echomail logins, so the "autoscript" can be different (PCBLOGIN vs
  35. //  NETLOGIN).
  36. //
  37. // ------------------------------------------------------------------------- //
  38.  
  39. str user_name[]  = "FTL MAILRUN";
  40. str city_state[] = "Robert Vostreys - Atlanta";
  41. str data_phone[] = "404-292-8761";
  42. str home_phone[] = "404-299-3930";
  43. str unknown_pw[] = "NEWPASSWORD";   // used if entry not in dialing directory
  44. str cpu_type[]   = "FTL 286/386/486's";
  45. str graphicsYN[] = "Y";             // do you want graphics or non?  (Y/N)
  46. str pro_door[]   = "3";             // door to open if logging into ProLogon
  47. str first_cmd[]  = "DOOR;3";        // door (first command) if in PCBoard
  48.  
  49. // ------------------------------------------------------------------------- //
  50.  
  51. main()
  52.  {
  53.    int stat = 0;
  54.    int flag = 0;
  55.    int t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15;
  56.    int t99 = 0;
  57.    int pcblogin = 0;
  58.    int endflag = 0;
  59.  
  60.    t1  = track(" graphics", 1);             //  ANSI Graphics Prompt
  61.    t2  = track("first name?", 1);           //  Name Prompt (put FN;LN^MPW)
  62.    t3  = track("Language #", 1);            //  Language Prompt (1=English?)
  63.    t4  = track("(H)elp, More?", 1);         //  Y/N/NS More prompt
  64.    t5  = track("continue", 1);              //  Press (ENTER) to continue
  65.    t6  = track("(Enter)=yes?", 1);          //  Scan messagebase (Y/N/A NS)
  66.    t7  = track("Command?", 1);              //  Main Board Command?
  67.    t8  = track("Conference memb", 1);       //  View Conference Members
  68.    t9  = track("as a new user?", 1);        //  OOPS! New user here!
  69.    t10 = track("word please!)?", 1);        //  Enter PASSWORD
  70.    t11 = track("City and State", 1);        //  City and State
  71.    t12 = track("DOOR #", 1);                //  ProLogin command prompt
  72.    t13 = track("Re-enter password", 1);     //  Verify new password login
  73.    t14 = track("(Dots will echo)", 1);      //  Actual Password Prompt
  74.    t15 = track("ProLogon");                 //  Look for ProLogin system
  75.  
  76. // ------------------------------------------------------------------------- //
  77.  
  78.   t99 = timer_start(200);                   // No response for 20 seconds
  79.  
  80.   while (carrier() and endflag == 0)
  81.  
  82.    {
  83.      terminal();
  84.  
  85.      stat = track_hit(0);                   // see if any flags set
  86.  
  87.      if (stat)                              // reset timer when track hits
  88.       {
  89.         timer_restart(t99, 200);
  90.       }
  91.  
  92.      if (time_up(t99))
  93.       {
  94.         status_wind("WAKEUP!", 1);
  95.         cputs("^M");
  96.         timer_free(t99);
  97.         t99 = timer_start(200);
  98.         terminal();
  99.       }
  100.  
  101.       if (stat == 15)
  102.        {
  103.          track_free(t3);
  104.          t3 = track("(0)=no");
  105.          pcblogin = 1;
  106.        }
  107.  
  108.       else if (stat == t3)                  // request language
  109.          cputs("1^M");
  110.  
  111.       else if (stat == t1)                  // ANSI graphics request
  112.        {
  113.          if (pcblogin == 0)
  114.           {
  115.             cputs(graphicsYN);
  116.             cputs(" Q NS^M");
  117.             terminal();
  118.           }
  119.          else                               // ProLogon quick login
  120.           {
  121.             track_free(t4);
  122.             t4 = track("(N)",1);
  123.             cputs(graphicsYN);
  124.             cputs(" Q ");
  125.             cputs(user_name);
  126.             cputs(" ");
  127.             cputs(_entry_pass);
  128.             cputs(" ");
  129.             cputs(pro_door);
  130.             cputs(" NS^M");
  131.             terminal();
  132.             endflag = 1;
  133.             status_wind("Login sequence completed...", 10);
  134.           }
  135.        }
  136.  
  137.       else if (stat == t2)                  // send Login Name
  138.        {
  139.          if (pcblogin == 0)
  140.           {
  141.             capture("*CLOSE*");
  142.             cputs(user_name); cputs("^M");
  143.           }
  144.          if (pcblogin == 1)                 // ProLogon quick login 2nd try
  145.           {
  146.             capture("*CLOSE*");
  147.             track_free(t4);
  148.             t4 = track("(N)",1);
  149.             cputs(user_name);
  150.             cputs(" ");
  151.             cputs(_entry_pass);
  152.             cputs(" ");
  153.             cputs(pro_door);
  154.             cputs(" NS^M");
  155.             terminal();
  156.             cputs("^M");
  157.             endflag = 1;
  158.             status_wind("Login sequence completed...", 10);
  159.           }
  160.        }
  161.  
  162.       else if (stat == t4)                  // don't want any "more"
  163.          cputs("No_More^M");
  164.  
  165.       else if (stat == t5)                  // "Enter" to continue
  166.          cputs("^M");
  167.  
  168.       else if (stat == t6 || stat == t8)    // No, don't show messages
  169.        {                                    // Yes, we want to register
  170.          if (flag == 0)                     // Also, no conf member scan
  171.             cputs("NoScan^M");
  172.          else
  173.           {
  174.             capture("*CLOSE*");
  175.             cputs("Yes^M");
  176.             flag = 0;
  177.           }
  178.        }
  179.  
  180.       else if (stat == t7 or stat == t12)   // Login Compleated
  181.        {
  182.          if (pcblogin == 0)
  183.           {
  184.             cputs(first_cmd);
  185.             cputs("^M");
  186.             terminal();
  187.             status_wind("Login sequence completed...", 10);
  188.             endflag = 1;
  189.           }
  190.          if (pcblogin == 1)
  191.           {
  192.             cputs(pro_door);
  193.             cputs("^M");
  194.             terminal();
  195.             status_wind("Login sequence completed...", 10);
  196.             endflag = 1;
  197.           }
  198.        }
  199.  
  200.       else if (stat == t9)                  // New User Login (Continue)
  201.        {
  202.          capture ("NEWLOGIN.CAP");
  203.          cputs("C^M");
  204.          flag = 1;
  205.        }
  206.  
  207.       else if (stat == t10 || stat == t13 || stat == 14)
  208.        {
  209.          Go_Password();                     // Password Entry / Verify / Go
  210.          track_free(t14);                   // don't allow the main password
  211.        }                                    // request to reoccur.
  212.  
  213.  
  214.       else if (stat == t11)                 // City/State Prompt
  215.        {
  216.          status_wind("NEW USER LOGIN!!", 20);
  217.          cputs(city_state);
  218.            cputs("^M");
  219.          cputs(data_phone);                 // also put dataphone
  220.            cputs("^M");
  221.          cputs(home_phone);                 // also put homephone
  222.            cputs("^M");
  223.          cputs(cpu_type);                   // also put cputype
  224.            cputs("^M");
  225.        }
  226.    }
  227.  
  228.   capture ("*CLOSE*");                      // Close any open captures
  229.   timer_free(t99);                          // Clear all timer channels
  230.   track_free(0);                            // Clear all track channels
  231.   return(0);                                // Exit this login script.
  232.  }
  233.  
  234. // ------------------------------------------------------------------------- //
  235.  
  236. Go_Password()
  237.  {
  238.    if (strlen(_entry_pass) < 2)
  239.     {
  240.       cputs(unknown_pw);
  241.       cputs(itos(_entry_num));
  242.     }
  243.    else
  244.       cputs(_entry_pass);
  245.    cputs("^M");
  246.  }
  247.  
  248. // ------------------------------------------------------------------------- //
  249.  
  250.